home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / July 96 / Re Stubs < prev    next >
Encoding:
Internet Message Format  |  1996-07-08  |  1.5 KB  |  [TEXT/ttxt]

  1. Subject:     Re: Stubs
  2. Sent:        7/8/96 3:10 PM
  3. Received:    7/8/96 3:11 PM
  4. From:        Mark Lanett, mlanett@meer.net
  5. Reply-To:    ODF Interest, ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8. >Setting the 'Include "weak" ' option in the CW project for the extension
  9. >libraries seems to have been the key to not having massive stack crashes.
  10. > When do I want a weak link, and when dont I?  Should any of the standard
  11. >OD or ODF libs be weak linked?
  12.  
  13. You should only use weak link when you want your part to be able to run
  14. without the specified library installed. This means that you must do a
  15. runtime check (to see whether a library is available) before calling into
  16. them.
  17.  
  18. In the case of a server part, which can not serve data without the
  19. extension, you would never weak link against it. However a client may be
  20. able to function without the server and should weak link against the
  21. extension, and make sure it's available before calling it (or creating an
  22. instance of it). For example, many Cyberdog-savvy parts can function
  23. perfectly well as normal OpenDoc parts if Cyberdog is not installed, so
  24. they should weak link against Cyberdog. You can determine whether they a
  25. library is available by comparing the address of an exported function with
  26. 0. For example:
  27.         Boolean HasCyberdog () {
  28.                 return (&GetCyberSession != 0);
  29.         }
  30. (where GetCyberSession is exported by the Cyberdog library).
  31.  
  32.  
  33. --
  34. Mark Lanett <mlanett@meer.net>
  35. Have a bajillion brilliant Jobsian lithium licks
  36.  
  37.  
  38.